home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 2: Applications / Linux Cubed Series 2 - Applications.iso / editors / emacs / xemacs / xemacs-1.004 / xemacs-1 / xemacs-19.13 / src / toolbar.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-08-26  |  4.1 KB  |  135 lines

  1. /* Define toolbar instance.
  2.    Copyright (C) 1995 Board of Trustees, University of Illinois
  3.  
  4. This file is part of XEmacs.
  5.  
  6. XEmacs is free software; you can redistribute it and/or modify it
  7. under the terms of the GNU General Public License as published by the
  8. Free Software Foundation; either version 2, or (at your option) any
  9. later version.
  10.  
  11. XEmacs is distributed in the hope that it will be useful, but WITHOUT
  12. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13. FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14. for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with XEmacs; see the file COPYING.  If not, write to the Free
  18. Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20. /* Synched up with: Not in FSF. */
  21.  
  22. #ifndef _XEMACS_TOOLBAR_H_
  23. #define _XEMACS_TOOLBAR_H_
  24.  
  25. #include "specifier.h"
  26.  
  27. enum toolbar_pos
  28. {
  29.   TOP_TOOLBAR,
  30.   BOTTOM_TOOLBAR,
  31.   LEFT_TOOLBAR,
  32.   RIGHT_TOOLBAR
  33. };
  34.  
  35. /* There are 4 of these per frame.  They don't really need to be an
  36.    lrecord (they're not lisp-accessible) but it makes marking slightly
  37.    more modular.  */
  38. struct toolbar_data
  39. {
  40.   struct lcrecord_header header;
  41.  
  42.   /* The last buffer for which the toolbars were displayed. */
  43.   Lisp_Object last_toolbar_buffer;
  44.  
  45.   /* The actual buttons are chained through this. */
  46.   Lisp_Object toolbar_buttons;
  47. };
  48.  
  49. DECLARE_LRECORD (toolbar_data, struct toolbar_data);
  50. #define XTOOLBAR_DATA(x) XRECORD (x, toolbar_data, struct toolbar_data)
  51. #define XSETTOOLBAR_DATA(x, p) XSETRECORD (x, p, toolbar_data)
  52. #define TOOLBAR_DATAP(x) RECORDP (x, toolbar_data)
  53. #define CHECK_TOOLBAR_DATA(x, i) CHECK_RECORD (x, toolbar_data)
  54.  
  55. #define FRAME_TOOLBAR_DATA(frame, position)                \
  56.   (XTOOLBAR_DATA ((frame)->toolbar_data[position]))
  57. #define FRAME_TOOLBAR_BUFFER(frame, position)    \
  58.   (XTOOLBAR_DATA ((frame)->toolbar_data[position])->last_toolbar_buffer)
  59.  
  60. /* These are chained together through toolbar_buttons in struct
  61.    toolbar_data.  These don't need to be an lrecord either, but again,
  62.    it makes marking easier. */
  63. struct toolbar_button
  64. {
  65.   struct lcrecord_header header;
  66.  
  67.   Lisp_Object next;
  68.   Lisp_Object frame;
  69.  
  70.   Lisp_Object up_glyph;
  71.   Lisp_Object down_glyph;
  72.   Lisp_Object disabled_glyph;
  73.  
  74.   Lisp_Object cap_up_glyph;
  75.   Lisp_Object cap_down_glyph;
  76.   Lisp_Object cap_disabled_glyph;
  77.  
  78.   Lisp_Object callback;
  79.   Lisp_Object enabled_p;
  80.   Lisp_Object help_string;
  81.  
  82.   char enabled;
  83.   char down;
  84.   char pushright;
  85.   char blank;
  86.  
  87.   int x, y;
  88.   int width, height;
  89.   int dirty;
  90. };
  91.  
  92. DECLARE_LRECORD (toolbar_button, struct toolbar_button);
  93. #define XTOOLBAR_BUTTON(x) XRECORD (x, toolbar_button, struct toolbar_button)
  94. #define XSETTOOLBAR_BUTTON(x, p) XSETRECORD (x, p, toolbar_button)
  95. #define TOOLBAR_BUTTONP(x) RECORDP (x, toolbar_button)
  96. #define CHECK_TOOLBAR_BUTTON(x, i) CHECK_RECORD (x, toolbar_button)
  97.  
  98. extern void get_toolbar_coords (struct frame *f, enum toolbar_pos pos, int *x,
  99.                 int *y, int *width, int *height, int *vert,
  100.                 int for_layout);
  101. extern Lisp_Object toolbar_button_at_pixpos (struct frame *f, int x_coord,
  102.                          int y_coord);
  103. DECLARE_SPECIFIER_TYPE (toolbar);
  104. extern Lisp_Object Qtoolbar;
  105. #define XTOOLBAR_SPECIFIER(x) XSPECIFIER_TYPE (x, toolbar)
  106. #define XSETTOOLBAR_SPECIFIER(x, p) XSETSPECIFIER_TYPE (x, p, toolbar)
  107. #define TOOLBAR_SPECIFIERP(x) SPECIFIER_TYPEP (x, toolbar)
  108. #define CHECK_TOOLBAR_SPECIFIER(x, i) CHECK_SPECIFIER_TYPE (x, i, toolbar)
  109.  
  110. #define DEFAULT_TOP_TOOLBAR_HEIGHT    37
  111. #define DEFAULT_BOTTOM_TOOLBAR_HEIGHT    0
  112. #define DEFAULT_LEFT_TOOLBAR_WIDTH    0
  113. #define DEFAULT_RIGHT_TOOLBAR_WIDTH    0
  114.  
  115. #define DEFAULT_TOOLBAR_BLANK_SIZE    8
  116. #define MINIMUM_SHADOW_THICKNESS    2
  117.  
  118. extern Lisp_Object Vtop_toolbar_height, Vbottom_toolbar_height;
  119. extern Lisp_Object Vleft_toolbar_width, Vright_toolbar_width;
  120.  
  121. extern void update_frame_toolbars (struct frame *f);
  122. extern void init_frame_toolbars (struct frame *f);
  123. extern void init_device_toolbars (struct device *d);
  124. extern void init_global_toolbars (struct device *d);
  125. extern void free_frame_toolbars (struct frame *f);
  126.  
  127.  
  128. #ifdef HAVE_X_WINDOWS
  129.  
  130. extern void x_redraw_exposed_toolbars (struct frame *f, int x, int y,
  131.                        int width, int height);
  132.  
  133. #endif /* HAVE_X_WINDOWS */
  134. #endif /* _XEMACS_TOOLBAR_H_ */
  135.